package com.ruoyi.zhjd.laboratory.modules.asphaltLowTemperatureElongation.controller;

import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
// import com.qzsoft.jeemis.common.utils.Result;
// import com.qzsoft.zhjd.common.utils.ResultUtils;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.zhjd.laboratory.modules.asphaltLowTemperatureElongation.service.AsphaltLowTemperatureElongationResService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.zhjd.laboratory.modules.asphaltLowTemperatureElongation.entity.AsphaltLowTemperatureElongationResEntity;

/**
 * 沥青低温延伸度试验仪_结果数据
 *
 * @author sx
 * @email
 * @date 2023-07-11 16:37:53
 */
@RestController
@RequestMapping("laboratory/asphaltLowTemperatureElongationRes")
public class AsphaltLowTemperatureElongationResController {

    @Autowired
    private AsphaltLowTemperatureElongationResService asphaltLowTemperatureElongationResService;

    /**
     * 列表
     */
    @RequestMapping("/page")
    //
    public R page(@RequestParam Map<String, Object> params){
        IPage page = asphaltLowTemperatureElongationResService.queryPage(params);
        return R.ok(page);
    }


    /**
     * 信息
     */
    @RequestMapping("/find/{id}")
    //
    public R find(@PathVariable("id") String id){
		AsphaltLowTemperatureElongationResEntity asphaltLowTemperatureElongationRes = asphaltLowTemperatureElongationResService.getInfo(id);
        return R.ok(asphaltLowTemperatureElongationRes);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //
    public R save(@RequestBody AsphaltLowTemperatureElongationResEntity asphaltLowTemperatureElongationRes){
		asphaltLowTemperatureElongationResService.saveData(asphaltLowTemperatureElongationRes);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //
    public R update(@RequestBody AsphaltLowTemperatureElongationResEntity asphaltLowTemperatureElongationRes){
        asphaltLowTemperatureElongationResService.updateData(asphaltLowTemperatureElongationRes);
        return R.ok();
    }


    /**
     * 删除单个
     */
    @RequestMapping("/delete/{id}")
    //
    public R deleteOne(@PathVariable("id") String id){
        asphaltLowTemperatureElongationResService.deleteOneData(id);
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //
    public R delete(@RequestBody String[] ids){
        asphaltLowTemperatureElongationResService.deleteData(Arrays.asList(ids));
        return R.ok();
    }
}
